import hashlib

d = hashlib.md5()
# with open('/etc/passwd') as f:
with open('./data.txt') as f:
    for line in f:
        d.update(line)

hexdigest = d.hexdigest()
print hexdigest
